package com.yky.action.common;

import java.util.List;

import org.apache.struts2.convention.annotation.InterceptorRef;
import org.apache.struts2.convention.annotation.InterceptorRefs;
import org.apache.struts2.convention.annotation.Namespace;
import org.apache.struts2.convention.annotation.ParentPackage;
import org.springframework.beans.factory.annotation.Autowired;

import com.yky.action.base.BaseActionSupport;
import com.yky.entity.Province;
import com.yky.service.admin.ProvinceService;
import com.yky.utils.JsonUtil;

@ParentPackage("perInterceptor")
@InterceptorRefs({@InterceptorRef("sessionStack")})
@Namespace(value = "/")
public class ProvinceAction extends BaseActionSupport {

	@Autowired
	private ProvinceService provinceService;

	public String getAll() throws Exception {
		List<Province> list = provinceService.findEntityList();
		super.printWriterJsonToPage(JsonUtil.formatToJson(list));
		return null;
	}

}
